
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(UGUITweenFillAmount))]
public class UGUITweenFillAmountEditor : UGUITweenerEditor
{
	public override void OnInspectorGUI ()
	{
		GUILayout.Space(6f);
		UGUIEditorTools.SetLabelWidth(120f);

        UGUITweenFillAmount tfa = target as UGUITweenFillAmount;
		GUI.changed = false;

        float from = EditorGUILayout.Slider("From", tfa.from, 0, 1);
        float to = EditorGUILayout.Slider("To", tfa.to, 0, 1);

        from = Mathf.Clamp01(from);
        to = Mathf.Clamp01(to);

        if (GUI.changed)
		{
			UGUIEditorTools.RegisterUndo("Tween Change", tfa);
			tfa.from = from;
			tfa.to = to;
			UGUITools.SetDirty(tfa);
		}

		DrawCommonProperties();
	}
}
